package com._23DesignPattern._action._strategy;

/**
 * @Author: huangya
 * @Date: 2019/6/3
 * @Description:
 */
public enum enumStrategyDemo {

    add("+"){
        @Override
        public int exec(int a, int b) {
            return a+b;
        }
    },sub("-"){
        @Override
        public int exec(int a, int b) {
            return a-b;
        }
    };


    public abstract int exec(int a, int b);

    String value = "";

    enumStrategyDemo(String value) {
        this.value = value;
    }

    public static void main(String[] args) {
        System.out.println(add.exec(1,2));
    }
}
